//
//  AppModule.h
//  iCodeMac
//
//  Created by Andrew Barry on 27/02/09.
//  Copyright 2009 Barry Computer Services. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@class AppStack;
@class SourceEditor;

@interface AppModule : NSObject {
	AppStack *stack;
	NSString *moduleName;
	NSString *source;
	NSDictionary *form;
	SourceEditor *activeEditor;
	NSString *scriptId;
	JSScript *compiledScript;
	JSObject *scriptObject;
	bool scriptObjectRooted;
	JSObject *runObject;
}
-(id) initWithStack: (AppStack *) s withDefn: (NSDictionary *) dict;
-(AppStack *) stack;
-(void) showCodeEditor;
-(void) setForm: (NSDictionary *) form;
-(NSDictionary *) form;
-(NSString *) scriptId;
-(bool) compile;
-(void) sourceEditorClosing;
-(void) runtimeErrorMessage: (NSString *) message withReport: (JSErrorReport *) report;
-(void) runInView: (NSView *) parent;
-(NSDictionary *) save;
-(void) runScript;

@end
